<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:ctg="http://www.crotouristguide.com/taglib"
	xmlns:c="http://java.sun.com/jstl/core">

<ui:component>
	<rich:panel id="dogadjaji" styleClass="no-border">
		<s:div styleClass="title"
			rendered="#{value.size > 0 or param.idMjesta != null}">
			<h2><h:outputText value="#{messages['title.dogadjaji']}" /></h2>
			<h:outputText value="#{messages['subtitle.dogadjaji']} " />
			<s:link action="#{dogadjajAction.addSetup('backToMjesto')}"
				rendered="#{param.idMjesta != null}"
				value="#{messages['label.link.add.new.event']}" propagation="none" styleClass="special1"/>
		</s:div>
		<rich:dataGrid columns="2" elements="4" value="#{value}" var="d"
			styleClass="list50" rendered="#{value.size > 0}" cellpadding="0"
			cellspacing="0" columnClasses="top,top" width="97%">
			<s:div styleClass="leftm">
				<h:outputLink styleClass="pnlWWW1" value="http://#{d.www}">
					<img alt="#{messages['label.image.alt']} #{d.mjesto.naziv}"
						width="90" height="60" src="#{slikaAction.getPocSlikaPath(d,'s')}">
					</img>
				</h:outputLink>
			</s:div>
			<s:div styleClass="left">
				<h:outputText
					value="#{stringUtil.formatDate('dd.MM.yyyy',d.datumOd)} - #{stringUtil.formatDate('dd.MM.yyyy',d.datumDo)} " />
				<br />
				<c:set value="#{d.getOpis(locale.language).naziv}" var="naziv" />
				<f:subview rendered="#{param.idMjesta == null}">
					<h:outputLink
						value="#{application.contextPath}/guides/mjesta/mjesto.seam">
						<f:param name="idMjesta" value="#{d.mjesto.idMjesta}" />
						<f:param name="l" value="#{currentLang}" />
						<f:param name="title" value="#{titleAction.getUrlTitle(mjesto)}" />
						<h:outputText value="#{naziv}" />
						<h:outputText value=", " rendered="#{naziv.length() > 0}" />
						<h:outputText value="#{d.mjesto.naziv}" />
					</h:outputLink>
				</f:subview>
				<f:subview rendered="#{param.idMjesta != null}">
					<h3><h:outputLink styleClass="pnlWWW1" value="http://#{d.www}">
						<h:outputText value="#{naziv}" />
						<h:outputText value=", " rendered="#{naziv.length() > 0}" />
						<h:outputText value="#{d.mjesto.naziv}" />
					</h:outputLink></h3>
				</f:subview>
			</s:div>
			<br class="clearb" />
			<p><h:outputText value="#{d.getOpis(locale.language).opis}" /></p>
		</rich:dataGrid>
		<f:subview rendered="#{value.size > 0}">
			<h:outputLink styleClass="pnlDogadjaji special1" value="#{url}">
				<h:outputText value="#{messages['label.link.more.events']}" />
			</h:outputLink>
			<ctg:nbsp />
			<s:link view="/guides/dogadjaji/list.xhtml"
				rendered="#{value.size > 4 or identity.hasRole('1') == true}"
				value="#{messages['label.view_all']}" propagation="none" styleClass="special1"/>
		</f:subview>
	</rich:panel>

	<script type="text/javascript">
		 jQuery(function() {	 
			 jQuery('.pnlDogadjaji').click(function() {
				new Boxy('<iframe frameborder="0" marginheight="0" marginwidth="0" src="' + this.href + '" class="loading"></iframe>',{title:'#{messages["title.dogadjaji"]}',modal:true}).resize(850,640);
				return false;
			 });
		 });

		 jQuery(function() {	 
			 jQuery('.pnlWWW1').click(function() {
				new Boxy('<iframe frameborder="0" marginheight="0" marginwidth="0" src="' + this.href + '" class="loading"></iframe>',{title:'WWW',modal:true}).resize(850,640);
				return false; 
			 });
		 });	 
	 </script>
</ui:component>

</html>